home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HyperLib 1997 Winter - Disc 1
/
HYPERLIB-1997-Winter-CD1.ISO.7z
/
HYPERLIB-1997-Winter-CD1.ISO
/
オンラインウェア
/
UTIL
/
DocAssembler 1.0 folder.sit
/
DocAssembler 1.0 folder
/
DocAssembler 1.0
/
DA sample script
< prev
next >
Wrap
Text File
|
1996-02-17
|
5KB
|
109 lines
(*
Sample script to show the DocAssembler's scripting features
Before using this sample script, you need:
- AppleScript software installed
- XTND software installed
- the DocAssembler application installed
- the "Examples" folder from the DocAssembler package in the same folder as DocAssembler
This example shows a Microsoft Word -> Microsoft RTF translation.
If the required translators are not available, you will have to change the script.
*)
tell application "DocAssembler 1.0"
activate
try
with timeout of 600 seconds
-- activate DocAssembler, create a new untitled document and remember it
activate
set theDoc to (make new document)
-- append some files along with their hierarchical level
-- Level 0 is the top (section) level
-- Level -1 is the second (sub-section) level
-- Level -2 is the third (chapter) level
-- Level -3 is the bottom (paragraph) level
tell theDoc to add the file ":Examples:Sample file #1" with level 0
tell theDoc to add the file ":Examples:Sample file #2" with level -1
tell theDoc to add the file ":Examples:Sample file #3" with level -1
tell theDoc to add the file ":Examples:Sample file #4" with level -2
tell theDoc to add the file ":Examples:Sample file #5" with level -3
-- assign the general preferences
tell theDoc to set preference units to inches
tell theDoc to set preference left margin to 1.5
tell theDoc to set preference right margin to 1.5
tell theDoc to set preference top margin to 2.0
tell theDoc to set preference bottom margin to 2.0
tell theDoc to set preference with double sided
tell theDoc to set preference with include indexes
tell theDoc to set preference starting page to 3
-- assign the left header preferences
tell theDoc to set output option left header with include
tell theDoc to set output option left header font to "Courier"
tell theDoc to set output option left header size to 14
tell theDoc to set output option left header style to plain -- this is needed to override existing preferences
tell theDoc to set output option left header style to underline
tell theDoc to set output option left header justification to center
tell theDoc to set output option left header color to blue
tell theDoc to set output option left header text to "This is a Courier 14, underlined, centered, blue left header"
-- assign the right header preferences
tell theDoc to set output option right header with include
tell theDoc to set output option right header font to "Geneva"
tell theDoc to set output option right header size to 12
tell theDoc to set output option right header style to plain -- this is needed to override existing preferences
tell theDoc to set output option right header style to bold
tell theDoc to set output option right header justification to right
tell theDoc to set output option right header color to red
tell theDoc to set output option right header text to "This is a Geneva 12, bolded, right justified, red right header"
-- assign the left footer preferences
tell theDoc to set output option left footer with include
tell theDoc to set output option left footer font to "Helvetica"
tell theDoc to set output option left footer size to 12
tell theDoc to set output option left footer style to plain -- this is needed to override existing preferences
tell theDoc to set output option left footer style to italic
tell theDoc to set output option left footer justification to left
tell theDoc to set output option left footer color to green
tell theDoc to set output option left footer text to "This is a Helvetica 12, italicized, left justified, green left footer"
-- assign the right footer preferences
tell theDoc to set output option right footer with include
tell theDoc to set output option right footer font to "Monaco"
tell theDoc to set output option right footer size to 12
tell theDoc to set output option right footer style to plain -- this is needed to override existing preferences
tell theDoc to set output option right footer style to outline
tell theDoc to set output option right footer justification to full
tell theDoc to set output option right footer color to cyan
tell theDoc to set output option right footer text to "This is a Monaco 12, outlined, full justified, cyan right footer"
-- produce an output file called "BuiltFromScript.rtf" asking to the RTF translator to make a RTF file
tell theDoc to produce the file ":Examples:BuiltFromScript.rtf" using translator "RTF" with format "TEXT"
-- save the DocAssembler document under the name "BuiltFromScript"
save theDoc in file ":Examples:BuiltFromScript"
end timeout
on error errText number errNum
beep
display dialog "An error occurred! " & errText & " Error code: " & errNum buttons {"Alas"} default button "Alas" with icon 0
close theDoc saving no
quit
return
end try
quit
end tell